import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import path from "path";
import vueJsx from "@vitejs/plugin-vue-jsx";
export default defineConfig({
  plugins: [uni(), vueJsx({})],
  resolve: {
    extensions: [".js", ".jsx", ".ts", ".tsx", ".json", ".vue"],
    alias: {
      "#": path.resolve(__dirname, "types"),
    },
  },
  server: {
    open: true,
    proxy: {
      "/api": {
        changeOrigin: true,
        rewrite: (path: string) => path.replace(/^\/api/, ""),
        target: "http://120.26.105.8:8082/",
      },
    },
  },
  css: {
    preprocessorOptions: {
      scss: {
        api: "modern-compiler",
        silenceDeprecations: ["legacy-js-api"],
      },
    },
  },
});
